import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '卡种名称',
    align:"center",
    dataIndex: 'cardTypeId_dictText'
   },
   {
    title: '购买数量',
    align:"center",
    dataIndex: 'number'
   },
   {
    title: '下单用户',
    align:"center",
    dataIndex: 'memberId_dictText'
   },
   {
    title: '订单金额',
    align:"center",
    dataIndex: 'totalAmount'
   },
  //  {
  //   title: '支付金额',
  //   align:"center",
  //   dataIndex: 'payAmount'
  //  },
   {
    title: '订单状态',
    align:"center",
    dataIndex: 'orderStatus_dictText'
   },
  //  {
  //   title: '订单支付时间',
  //   align:"center",
  //   dataIndex: 'payTime'
  //  },
   {
    title: '支付订单号',
    align:"center",
    dataIndex: 'outTradeNo'
   },
  //  {
  //   title: '微信支付订单号',
  //   align:"center",
  //   dataIndex: 'transactionId'
  //  },
   {
    title: '支付状态',
    align:"center",
    dataIndex: 'payStatus_dictText'
   },
   {
    title: '退款状态',
    align:"center",
    dataIndex: 'refundStatus_dictText'
   },
  //  {
  //   title: '退款时间',
  //   align:"center",
  //   dataIndex: 'refundTime'
  //  },
  //  {
  //   title: '微信退款单号',
  //   align:"center",
  //   dataIndex: 'refundId'
  //  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [

  {
    label: "卡种",
    field: 'cardTypeId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"app_card_typ,name,id"
    },
    //colProps: {span: 6},
 },
{
    label: "订单状态",
    field: "orderStatus",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"card_order_status"
    },
 },

];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '卡种id',
    field: 'cardTypeId',
    component: 'Input',
  },
  {
    label: '用户',
    field: 'memberId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"app_member,nick_name,id"
     },
  },
  {
    label: '购买数量',
    field: 'number',
    component: 'InputNumber',
  },
  {
    label: '订单金额',
    field: 'totalAmount',
    component: 'InputNumber',
  },
  {
    label: '支付金额',
    field: 'payAmount',
    component: 'InputNumber',
  },
  {
    label: '订单状态',
    field: 'orderStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"card_order_status"
     },
  },
  {
    label: '订单支付时间',
    field: 'payTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '支付订单号',
    field: 'outTradeNo',
    component: 'Input',
  },
  {
    label: '微信支付订单号',
    field: 'transactionId',
    component: 'Input',
  },
  {
    label: '支付状态',
    field: 'payStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"card_pay_status"
     },
  },
  {
    label: '退款状态',
    field: 'refundStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"card_refund_status"
     },
  },
  {
    label: '退款时间',
    field: 'refundTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '微信退款单号',
    field: 'refundId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  cardTypeId: {title: '卡种id',order: 0,view: 'text', type: 'string',},
  number: {title: '购买数量',order: 1,view: 'number', type: 'number',},
  totalAmount: {title: '订单金额',order: 2,view: 'number', type: 'number',},
  payAmount: {title: '支付金额',order: 3,view: 'number', type: 'number',},
  orderStatus: {title: '订单状态',order: 4,view: 'number', type: 'number',dictCode: 'card_order_status',},
  payTime: {title: '订单支付时间',order: 5,view: 'datetime', type: 'string',},
  outTradeNo: {title: '支付订单号',order: 6,view: 'text', type: 'string',},
  transactionId: {title: '微信支付订单号',order: 7,view: 'text', type: 'string',},
  payStatus: {title: '支付状态',order: 8,view: 'number', type: 'number',dictCode: 'card_pay_status',},
  refundStatus: {title: '退款状态',order: 9,view: 'number', type: 'number',dictCode: 'card_refund_status',},
  refundTime: {title: '退款时间',order: 10,view: 'datetime', type: 'string',},
  refundId: {title: '微信退款单号',order: 11,view: 'text', type: 'string',},
  memberId: {title: '用户',order: 12,view: 'list', type: 'string',dictTable: "app_member", dictCode: 'id', dictText: 'nick_name',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}